<template>
	<view>
		<view class="qunming">群名称：1234</view>
		<view class="content">
			<view class="persons" v-for="(item,index) in arrList" :key="index">
				<image class="img" :src="item.avatar || '../../static/image/bg_img.png'"></image>
				<view>{{item.nickname}}</view>
			</view>
			<view class="persons">
				<image class="img2" src="../../static/image/jia.png" @click="pullPeople"></image>
			</view>
		</view>
		<view class="qunming"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arrList:[],
				avatar: '',
				group_id:'',//群id
			}
		},
		onLoad(option){
			this.group_id = option.group_id;
			this.initDat();
		},
		onShow(){
			this.$msgchat.initwork();
			this.initDat();
		},
		methods: {
			//初始数据
			initDat(){
				this.$common.requests('/api/index/getgroupman',{group_id:this.group_id}).then(res => {
					if(res.data.code == 1){
						for(let i=0;i<res.data.data.length;i++){
							if(res.data.data[i].avatar != ''){
								res.data.data[i].avatar = this.$common.baseUrl + res.data.data[i].avatar
							}
						}
						this.arrList = res.data.data;
					}
				})
			},
			pullPeople(){
				uni.navigateTo({
					url:'../pullPeople/pullPeople?group_id='+this.group_id
				})
			}
		}
	}
</script>

<style>
.qunming{
	margin: 0 30upx;
	padding: 30upx 0;
	border-bottom: solid 2upx #EEEEEE;
}
.content{
	margin: 0 30upx;
	display: flex;
	justify-content: flex-start;
	flex-wrap: wrap;
}
.persons{
	width: 20%;
	text-align: center;
	padding: 25upx 0;
}
.img{
	width: 90upx;
	height: 90upx;
}
.img2{
	width: 110upx;
	height: 110upx;
}
</style>
